﻿using System;
using System.Collections.Generic;
using System.Text;
using Entity;
using System.Data.SqlClient;
using System.Data;
using ECommerce.DAL;

namespace Entity
{
    [System.ComponentModel.DataObject]

    public class TblProductWishListExtended : TblProductWishList 
    {

        public static ECommerce.DAL.CustomCollection<TblProductWishList> GetTblProductWishListBySystemUsertId(int SystemUserId)
        {
            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();

            AddParameterToSqlCmd(sqlCmd, "@SystemUserId", SqlDbType.Int, 0, ParameterDirection.Input, SystemUserId);


            SetCommandType(sqlCmd, CommandType.StoredProcedure, SP_TBL_PRODUCT_WISH_LIST_BY_SYSTEM_USER_ID);
            GenerateCollectionFromReader reader = new GenerateCollectionFromReader(GenerateTblProductWishListCollectionFromReader);
            CustomCollection<TblProductWishList> objCollection = ((CustomCollection<TblProductWishList>)ExecuteReaderCmd(sqlCmd, reader));

            return objCollection;
        }
        public static ECommerce.DAL.CustomCollection<TblProductWishList> GetTblProductWishListByProductAndSystemUsertId(int productId, int SystemUserId)
        {
            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            AddParameterToSqlCmd(sqlCmd, "@ProductId", SqlDbType.Int, 0, ParameterDirection.Input, productId);
            AddParameterToSqlCmd(sqlCmd, "@SystemUserId", SqlDbType.Int, 0, ParameterDirection.Input, SystemUserId);


            SetCommandType(sqlCmd, CommandType.StoredProcedure, SP_TBL_PRODUCT_WISH_LIST_BY_PRODUCT_ID_AND_SYSTEM_USER_ID);
            GenerateCollectionFromReader reader = new GenerateCollectionFromReader(GenerateTblProductWishListCollectionFromReader);
            CustomCollection<TblProductWishList> objCollection = ((CustomCollection<TblProductWishList>)ExecuteReaderCmd(sqlCmd, reader));

            return objCollection;
        }
     

        private const string SP_TBL_PRODUCT_WISH_LIST_BY_SYSTEM_USER_ID = "sp_TblProductWishList_GetProductWishListBySystemUserId";
        private const string SP_TBL_PRODUCT_WISH_LIST_BY_PRODUCT_ID_AND_SYSTEM_USER_ID = "sp_TblProductWishList_GetProductWishListByProductIdAndSystemUserId";

    }
   
}
